#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
	int x1 = 0, y1 = 0, x2 = 0, y2 = 0;

	scanf("%d%d%d%d", &x1, &y1, &x2, &y2);

	x2 -= x1;
	y2 -= y1;

	if (abs(x2) == abs(y2))
		printf("%d\n", x2 == 0 ? 0 : 1);
	else if (abs(x2 - y2) % 2)
		printf("0\n");
	else
		printf("2\n");

	return 0;
}
